Page({
    data: {
      params: {
        page: 1,
        size: 999999,
        userId: wx.getStorageSync('userId'),
        isUsed: 0,
        expire: new Date().getTime()
      },
      list: []
    },

    //获取
    getList (params) {
      var _this = this
      wx.request({
        url: 'https://devapi.xiaoshitimebank.com/user/sdx/sdx/sdxBookTickt/find/auth',
        data: params,
        method: 'POST',
        header: {
          "content-type": "application/x-www-form-urlencoded; charset=UTF-8",
        "token" : wx.getStorageSync('token'),
          "uid" : wx.getStorageSync('uuid')
        },
        success: (res) => {
          if (res.data.code == 200) {
            var arr = res.data.data
            _this.setData({
              list: arr
            })
          }else{
            wx.showToast({
              title: res.data.msg,
              icon: 'none'
            })
          }
        }
      })
    },
    //去使用按钮

    goShiyong () {
      wx.switchTab({
        url: '/pages/index/index',
      })
    },

    //卖书赚钱

    goMaishu () {
      wx.switchTab({
        url: '/pages/juanshu/juanshu',
      })
    },

    onShow () {
      this.getList(this.data.params)
    }
})
